home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gimp.idb / usr / freeware / share / gimp / scripts / land.scm.z / land.scm
Encoding:
Text File  |  1999-07-21  |  2.8 KB  |  89 lines

  1. ; The GIMP -- an image manipulation program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ; Land --- create a pattern that resembles a Topographic map
  4. ; Copyright (C) 1997 Adrian Karstan Likins
  5. ; aklikins@eos.ncsu.edu
  6. ;
  7. ;      This script works on the current gradient you have loaded. 
  8. ;      Some suggested gradients: 
  9. ;            Land                  (produces a earthlike map)
  10. ;            Brushed_aluminum      (looks like the moon)
  11. ;  
  12. ;
  13. ; Thanks to Quartic for helping me debug this thing. 
  14. ;
  15. ; This program is free software; you can redistribute it and/or modify
  16. ; it under the terms of the GNU General Public License as published by
  17. ; the Free Software Foundation; either version 2 of the License, or
  18. ; (at your option) any later version.
  19. ; This program is distributed in the hope that it will be useful,
  20. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. ; GNU General Public License for more details.
  23. ; You should have received a copy of the GNU General Public License
  24. ; along with this program; if not, write to the Free Software
  25. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  26.  
  27.  
  28.  
  29. (define (script-fu-land width height seed detail landheight seadepth xscale yscale)
  30.   (let* (
  31.      (img (car (gimp-image-new width height RGB)))
  32.      (layer-one (car (gimp-layer-new img width height RGB "bottom" 100 NORMAL)))
  33.     )
  34.  
  35.   (gimp-image-disable-undo img)
  36.   (gimp-image-add-layer img layer-one 0)
  37.  
  38.  
  39.  
  40.   (plug-in-solid-noise 1 img layer-one TRUE FALSE seed detail xscale yscale)
  41.   (plug-in-c-astretch 1 img layer-one)
  42.   (set! layer-two (car (gimp-layer-copy layer-one TRUE)))
  43.   (gimp-image-add-layer img layer-two -1)
  44.   (gimp-image-set-active-layer img layer-two)
  45.  
  46.   (plug-in-gradmap 1 img layer-two)
  47.  
  48.  
  49.  
  50.   (gimp-by-color-select img layer-one '(190 190 190) 55 REPLACE FALSE FALSE 0 FALSE)
  51.   (plug-in-bump-map 1 img layer-two layer-one 135.0 35 landheight 0 0 0 0 TRUE FALSE 0)
  52.  
  53.   ;(plug-in-c-astretch 1 img layer-two)
  54.   (gimp-selection-invert img)
  55.   (plug-in-bump-map 1 img layer-two layer-one 135.0 35 seadepth 0 0 0 0 TRUE FALSE 0)
  56.  
  57.   ;(plug-in-c-astretch 1 img layer-two)
  58.  
  59.   ; uncomment the next lie if you wnat to keep a selrction of the "land"
  60.   (gimp-selection-none img)
  61.  
  62.   (gimp-display-new img)
  63.   (gimp-image-enable-undo img)
  64. ))
  65.  
  66. (script-fu-register "script-fu-land"
  67.             "<Toolbox>/Xtns/Script-Fu/Patterns/Land"
  68.             "A Topgraphic Map  pattern"
  69.             "Adrian Likins <aklikins@eos.ncsu.edu>"
  70.             "Adrian Likins"
  71.             "1997"
  72.             ""
  73.             SF-VALUE "Image Width" "256"
  74.             SF-VALUE "Image Height" "256"
  75.             SF-VALUE "Random Seed" "32"
  76.             SF-VALUE "Detail Level" "4"
  77.             SF-VALUE "Land height" "60"
  78.             SF-VALUE "Sea depth" "4"
  79.             SF-VALUE "X Scale" "4.0"
  80.             SF-VALUE "Y Scale" "4.0")
  81.  
  82.  
  83.  
  84.  
  85.